home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / WAIS / ir / sigsrch.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-02  |  2.0 KB  |  90 lines

  1. /* WIDE AREA INFORMATION SERVER SOFTWARE
  2.    No guarantees or restrictions.  See the readme file for the full standard
  3.    disclaimer.    
  4. */
  5.  
  6.  
  7. /* implements the search part of irext.h 
  8.    (search_word and finished_search_word)
  9.    Stub for tracy shen.
  10.  */
  11.  
  12. #include "cdialect.h"
  13. #include "irfiles.h"
  14. #include "irsearch.h"
  15. #include "irext.h"
  16. #include <string.h>
  17.  
  18. /*===========================*
  19.  *===  Setting Paramters  ===*
  20.  *===========================*/
  21.  
  22. long max_hit_retrieved = 0;
  23.  
  24. long set_query_parameter (mask, parameters)
  25.      long mask;
  26.      query_parameter_type * parameters;
  27. {
  28.   switch (mask)
  29.     {
  30.     case SET_MAX_RETRIEVED_MASK:
  31.       max_hit_retrieved = parameters->max_hit_retrieved;
  32.       break;
  33.     default:
  34.       break;
  35.     }
  36. }
  37.  
  38.  
  39.  
  40. /*=============================*    
  41.  *===  Searching for words  ===*
  42.  *=============================*/
  43.  
  44. long search_word(word,char_pos, line_pos, weight, doc_id, dictionary_value,
  45.          db)
  46.      char *word; /* the word to be searched for */
  47.      long char_pos;        /* the position of the start of the word */
  48.      long line_pos;        /* is this needed? not for signature system */
  49.      long weight;        /* how important the word looks syntactically,
  50.                    such as is it bold */
  51.      long doc_id;        /* current document, seed words is 0,
  52.                    then it increments into the relevant 
  53.                    document */
  54.      long dictionary_value;    /* this is from the disk dictionary,
  55.                    a signature system would use weight,
  56.                    inverted file systems would put
  57.                    position information */
  58.      database *db;
  59. {
  60.   return sig_search_word(word, char_pos, line_pos,
  61.              weight, 0L, doc_id, 0L, dictionary_value, db);
  62. }
  63.  
  64.  
  65.  
  66. /*===================*
  67.  *===  Best Hits  ===*
  68.  *===================*/
  69.  
  70.  
  71. long finished_search_word(db)
  72.      database *db;
  73.   return(sig_finished_search_word(db));
  74. }
  75.  
  76.  
  77. /* returns the next best hit */
  78. long best_hit(doc_id, score)
  79.      long *doc_id;    
  80.      long *score;
  81. {
  82.   return(sig_best_hit(NULL, doc_id, NULL, score));
  83. }
  84.  
  85. long finished_best_hit()
  86.   return(sig_finished_best_hit());
  87. }
  88.